#include "FreeRTOS.h"
#include "task.h"
#include "main.h"
#include "cmsis_os2.h"

/* Definitions for myQueue01 */
extern osMessageQueueId_t myQueue01Handle;
extern const osMessageQueueAttr_t myQueue01_attributes;
/* Definitions for myQueue02 */
extern osMessageQueueId_t myQueue02Handle;
extern const osMessageQueueAttr_t myQueue02_attributes;

#define ringbuff_len	(4)
#define databuff_len	(256)
typedef struct {
	uint8_t len;
	uint8_t data[databuff_len];
} DataBuff;
typedef struct {
	uint8_t head;
	uint8_t tail;
	uint8_t lenght;
	DataBuff data_buff[ringbuff_len];
} RingBuff;

void
RingBuffIni(RingBuff *pbuff);
uint8_t
Read_RingBuff(RingBuff *pbuff, DataBuff *rdata);
uint8_t
Write_RingBuff(RingBuff *pbuff, uint8_t *buf, uint8_t len);

